﻿using Autofac;
using Autofac.Extras.Quartz;
using Sample.Jobs;
using System;
using System.Collections.Generic;
using System.Text;

namespace Sample.Topshelf.Extensions
{
    public static class QuartzExtensions
    {
        public static ContainerBuilder ConfigureQuartz(this ContainerBuilder builder)
        {
            // 1) Register IScheduler
            builder.RegisterModule(new QuartzAutofacFactoryModule());
            // 2) Register jobs
            builder.RegisterModule(new QuartzAutofacJobsModule(typeof(MyJob1).Assembly));

            return builder;
        }
    }
}
